package com.ede.roverhu.simplebackstage.Utils;

/**
 * Created by Admin on 2017/7/5.
 */

public class NumCov {

    public static int byteArrayToInt(byte[] b) {
        return b[1] & 0xFF |
                (b[0] & 0xFF) << 8;
    }

    //|
//        (b[1] & 0xFF) << 16 |
//            (b[0] & 0xFF) << 24;
    public static byte[] intToByteArray(int a) {
        return new byte[]{
                (byte) ((a >> 24) & 0xFF),
                (byte) ((a >> 16) & 0xFF),
                (byte) ((a >> 8) & 0xFF),
                (byte) (a & 0xFF)
        };
    }
}
